package bookStore.tool;

import java.util.Enumeration;
import java.util.HashMap;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

public class ParameterMapUtil {
	
	public static Map<String,String> createParameterMapFormRequest(HttpServletRequest request) {
		Enumeration<String> parameterNames=request.getParameterNames();
		Map<String,String> parametersMap = new HashMap<>();
		while(parameterNames.hasMoreElements()) {
			String name=parameterNames.nextElement();
			parametersMap.put(name,request.getParameter(name));
		}
		return parametersMap;
		
	}
}
